package miracle.joker.design.factory_method;

public class FactoryMethodDemo {

    public static void main(String[] args) {
        AnimalFactory catFactory = new CatFactory();
        AnimalFactory dogFactory = new DogFactory();

        Animal animal1 = catFactory.createAnimal("金吉拉");
        Animal animal2 = dogFactory.createAnimal("哈士奇");

        animal1.makesound();
        animal2.makesound();
    }
}
